package com.neusoft.neuiotms.dcom.model.malfunction;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@Entity
@org.hibernate.annotations.Table(appliesTo = "neuiot_malfunction_customer_review", comment = "故障客户评价表")
@Table(name = "neuiot_malfunction_customer_review")
public class MalfunctionCustomerReview extends AbstractAuditModel {

    private static final long serialVersionUID = 1L;

    /** 工作流TaskId */
    @Length(max = 255, message = "工作流TaskId不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '工作流TaskId'")
    private String taskId;

    /** 工单号 */
    @Length(max = 50, message = "工单号不能超过{max}位")
    @Column(length = 50, nullable = false)
    @Comment("varchar(50) NOT NULL COMMENT '工单号'")
    private String workNum;

    /** 客户满意度 */
    @Length(max = 255, message = "客户满意度不能超过{max}位")
    @Column(length = 255, nullable = true)
    @Comment("varchar(255) NULL DEFAULT NULL COMMENT '客户满意度'")
    private String satisfaction;

    /** 附件列表 **/
    @OneToMany(mappedBy = "customerReview", cascade = CascadeType.ALL)
    private List<MalfunctionCustomerReviewAnnex> annex = new ArrayList<>();
}
